package com.jml.LinkedList;

import java.util.LinkedList;

public class MainLinkedList {

	 static LinkedList a =  new LinkedList();

	public static void main(String[] args) {
		ExtLinkedList<String> extLinkedList = new ExtLinkedList<String>();
		add(extLinkedList);
		getAllData(extLinkedList);

		extLinkedList.add(3,"bb");
		getAllData(extLinkedList);

		extLinkedList.add(0,"aa");
		getAllData(extLinkedList);

		extLinkedList.remove(0);
		getAllData(extLinkedList);
		extLinkedList.remove(7);
		getAllData(extLinkedList);
		extLinkedList.remove(5);
		getAllData(extLinkedList);

	}

	private static void getAllData(ExtLinkedList<String> extLinkedList) {
		System.out.println("---------------------------------");
		for (int i = 0; i < extLinkedList.size; i++) {
			System.out.println(extLinkedList.get(i).item);
		}
	}

	private static void add(ExtLinkedList<String> extLinkedList) {
		extLinkedList.add("1");
		extLinkedList.add("2");
		extLinkedList.add("3");
		extLinkedList.add("4");
		extLinkedList.add("5");
		extLinkedList.add("6");
		extLinkedList.add("7");
	}



}
